//
//  NativeFirstViewController.swift
//  Runner
//
//  Created by 李旭峰 on 2020/10/10.
//

import UIKit

class NativeFirstViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        let btn = UIButton(type: .custom)
        self.view.addSubview(btn)
        btn.frame = CGRect(x: 20, y: 100, width: 200, height: 40)
        btn.backgroundColor = UIColor.blue
        btn.setTitle("Push Flutter Page", for: .normal)
        btn.setTitleColor(UIColor.white, for: .normal)
        btn.addTarget(self, action: #selector(onClickPushFlutterPage(_:forEvent:)), for: .touchUpInside)
    }
    
    @objc private func onClickPushFlutterPage(_ sender: UIButton, forEvent event: UIEvent){
//        FlutterBoostPlugin.open(kFlutterFirstViewPageUrl, urlParams:[kPageCallBackId:"MycallbackId#1"], exts: ["animated":true], onPageFinished: { (_ result:Any?) in
//            print(String(format:"call me when page finished, and your result is:%@", result as! CVarArg));
//        }) { (f:Bool) in
//            print(String(format:"page is opened"));
//        }
    }

}
